package com.tender.exceptions;

import lombok.Data;
import com.tender.enums.ErrorTypeEnum;

@Data
public class CommonException extends RuntimeException {

    private final Integer code;

    public CommonException (String msg, Integer code) {
        super(msg);
        this.code = code;
    }

    public CommonException (ErrorTypeEnum errorCodeEnum) {
        super(errorCodeEnum.getErrorMsgCn());
        this.code = errorCodeEnum.getCode();
    }
}
